using System.Reflection;
using Microsoft.EntityFrameworkCore;
using Zhaoxi.MSACommerce.ProductService.Core.Entities;

namespace Zhaoxi.MSACommerce.ProductService.Infrastructure.Data.Configuration;

public class ProductDbContext(DbContextOptions<ProductDbContext> options):DbContext(options)
{
    public DbSet<Spu>  Spus => Set<Spu>();
    public DbSet<Sku>  Skus => Set<Sku>();
    public DbSet<SpuDetail>  SpuDetails => Set<SpuDetail>();
    
    
    
    
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        base.OnModelCreating(modelBuilder);
        modelBuilder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly());
    }
}